Skip to content

Conversation

suzannaratcliff
Copy link
Contributor

@suzannaratcliff suzannaratcliff commented Apr 14, 2025

Add runtime issue kind and record issue with a kind

Motivation:

Runtime issues are reports of programming errors at runtime. These are different than test failures because those are pointing out issues in your project while runtime issues point out errors in how/what you code.

This will allow anyone to report a runtime issue during a test.

Runtime Issues:

This will allow users to create issues but with the type runtime and inspect the type when needed

  public enum Kind: Sendable {
    
    /// An issue which occurred during runtime, either by the system or by using a test author recording it using
    /// ``Issue/record(_:sourceLocation:)``.
    case runtime
  }

Users will be able to create a Runtime Issue with the following syntax:

Issue.record("My comment", kind: .runtime)

Modifications:

  • Added support for specifying a kind when recording an issue
  • Added a runtime issue type for users to report runtime issues

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@grynspan
Copy link
Contributor

We should probably workshop the name of this case a bit and figure out what it can actually be used for. I wouldn't want it to be tightly coupled to Apple-specific implementation details, for instance. If it is ultimately Apple-only, it may not make sense to expose it on other platforms.

Copy link
Contributor

@grynspan grynspan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not add kind as an argument to record(). It is intentionally omitted.

@suzannaratcliff suzannaratcliff added this to the Swift 6.x milestone Apr 14, 2025
@suzannaratcliff suzannaratcliff self-assigned this Apr 14, 2025
@suzannaratcliff suzannaratcliff added enhancement New feature or request issue-handling Related to Issue handling within the testing library labels Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request issue-handling Related to Issue handling within the testing library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants